package me.duzhi.ilog.cms.controller;

import com.alibaba.fastjson.JSONObject;
import com.jfinal.core.Const;
import com.jfinal.i18n.I18n;
import io.jpress.core.JBaseController;
import io.jpress.router.RouterMapping;

@RouterMapping(url="/lang")
public class JI18nController extends JBaseController {
    public void index(){
        if(getCookie("_locale")!=null&&getCookie("_locale").equals("en_US")){
            setCookie("_locale","zh_CN", Const.DEFAULT_I18N_MAX_AGE_OF_COOKIE);
        }else{
            setCookie("_locale","en_US", Const.DEFAULT_I18N_MAX_AGE_OF_COOKIE);
        }
        redirect("/");
    }
}
